<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
	<%@ taglib prefix="ft" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript">
	function abc(value,index,row){
		return ${teame};
	}
	function abcname(value,index,row){
		return '${teamename}';
		 
	}
	//xai一步
	$(function(){
		$("#team_sava").linkbutton({onClick:function(){
			$("<form method='post'>").appendTo(document.body).form({
				url: 'shq_teams_paibanadds',
				onSubmit: function(params){
					params["teamId"] =${teame};
					params["scheduId"] = ${teas};
				},
				success:function(v){
					v = eval("(" + v + ")");
					if(v.success){
							$.messager.alert('提示', '保存成功');
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
					}
				}
			}).submit();
		}});
		 $('#to_sones').linkbutton({
			onClick : function() {
				$("#shq_paiban_div").panel({
					href : "to_core_one"
				});
			}
		});
		//上一步
		/* $('#to_sones').linkbutton({
			onClick : function() {
				var teamId=${teame};
				var scheduId= ${teas};
				alert(scheduId+""+teamId);
				$("#shq_paiban_div").panel({
					href : "to_core_ones?teamId="+teamId+"&scheduId="+scheduId
				});
			}
		}); */
	})
	
	</script>

	<div id="shets_twes" class="easyui-panel"
		data-options="fit:true,border:false">
	<div style="padding: 1px; height: auto; background: #e0ecff">
		<!-- <a class="easyui-linkbutton"
			data-options="iconCls:'icon-undo',text:'取消',plain:true"></a> --> <a
			class="easyui-linkbutton"
			data-options="iconCls:'icon-add',plain:true"id="to_sones">上一步</a> <a
			class="easyui-linkbutton"
			data-options="iconCls:'icon-remove',plain:true"id="team_sava">保存</a> 
			<!-- <a class="easyui-linkbutton"
			data-options="iconCls:'icon-reload',plain:true">回到第一步</a> -->
	</div>
		
		<c:forEach items="${attr}" var="d">
		<div style="background:#E1F3F0;height:40px;font-size:15px;padding-top:10px;padding-left:10px;">
			开始时间:${year+1900}年${month+1}月${d}号<a style="color:red;font-size:15px;">（星期${attrday}）</a>
		</div>
		<table class="easyui-datagrid" cellspacing="10" id="qpb_core"
			data-options="   
				url:'to_core_twe_findsall?zhouqiId='+${teas},  
				rownumbers:true,
				Striped:true, 
				singleSelect:true
				">
			<thead>
					<tr>
					<!-- <input id="teamnames" class="easyui-combobox" name=""
								data-options="label:'班组编号', valueField:'teamId',textField:'teamName',url:'to_findall_teamname',plain:true,panelHeight:'auto',width:300,labelWidth:130"
							/> -->
					<th id="teamids" data-options="field:'m',width:100,align:'center',formatter:abc">
						班组编号
					</th>
					<th id="teamnames" data-options="field:'mw',width:100,align:'center',formatter:abcname">
						班组名称
					</th>
					<th id="scheduIds"type="hidden" data-options="field:'scheduId',width:100,align:'center'">
						模板编号
					</th>
					<th id="pbone"
						data-options="field:'cycle',width:120,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">
					${d}  
				</th>
					<th id="pbtwe"
						data-options="field:'scheduTeam',width:100,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">${d+1}</th>
					<th id="pbthree"
						data-options="field:'scheduCurrentcycle',width:100,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">${d+2}</th>
					<th id="pbfour"
						data-options="field:'scheduCurrentteam',width:100,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">${d+3}</th>
					<th id="pbfive"
						data-options="field:'scheduPerson',width:100,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">${d+4}</th>
					<th id="pbsix"
						data-options="field:'scheduRemarks',width:100,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">${d+5}</th>
					<th id="pbseve"
						data-options="field:'scheduState',width:100,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">${d+6}</th>
				</tr>
			</thead>
			<tbody>

			</tbody>
		</table>

				</c:forEach>
	</div>
</body>
</html>